<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./lib/react.development.js"></script>
    <script src="./lib/react-dom.development.js"></script>
    <script src="./lib/babel.min.js"></script>
</head>
<body>
    <div id="root"></div>
</body>
<script type="text/babel">
    // const root = ReactDOM.createRoot(document.querySelector("#root"));
    // root.render((
    //     <div></div>
    // ))

    const root = document.querySelector('#root');
    function Footer(){
        return <div>Footer组件</div>
    }
    function render(FunCom, root){
        console.log(FunCom);
        // 调用函数组件创建 虚拟dom
        const vdom = FunCom.type();
        console.log('vdom: ', vdom);
        // 创建真实dom
        const realDom = document.createElement(vdom.type);
        realDom.innerHTML = vdom.props.children;
        root.appendChild(realDom);
    }
    render(<Footer/>, root);
</script>
</html>